// components/page-box/index.js
Component({
  /**
   * 组件的属性列表
   */
  properties: {

  },

  /**
   * 组件的初始数据
   */
  data: {
    roleList: [
      {name: '首页', value: 1, img: '', url: '/pages/index/index'},
      {name: '预约', value: 2, img: '', url: '/pages/pre-book/index'},
      {name: '我的', value: 3, img: '', url: '/pages/mine/index'},

    ]
  },
  created(){
    let role = wx.getStorageSync('userRole') || wx.getStorageSync('loginData').loginType;
    switch(role){
      case '1' :
        console.log('role1', role)
        this.setData({
          roleList: [
            {name: '流水', value: 1, img: '', url: '/pages/order-flow/index'},
            {name: '订单', value: 2, img: '', url: '/pages/service-order/index'},
            {name: '我的', value: 3, img: '', url: '/pages/service-mine/index'},
          ]
        })
      break;
      case '2' :
        this.setData({
          roleList: [
            {name: '首页', value: 1, img: '', url: '/pages/index/index'},
            {name: '预约', value: 2, img: '', url: '/pages/pre-book/index'},
            {name: '我的', value: 3, img: '', url: '/pages/mine/index'},
          ]
        })
        break;
    }
  },

  /**
   * 组件的方法列表
   */
  methods: {

  }
})
